import { useCartStore } from "@/stores";
export const CommonCartEffect = () => {
  const cartStore = useCartStore();
  const { cartList } = cartStore;
  const changeItemToCart = (shopId, productId, productInfo, num) => {
    cartStore.changeItemToCart(shopId,productId, productInfo, num);
  };
  const changeChecked = (shopId,productId)=>{
    cartStore.changeChecked(shopId,productId)
    return {changeChecked}
  };
  const clearCart = (shopId) =>{
    cartStore.clearCart(shopId)
    return {clearCart}
  };
  const allCart = (shopId) =>{
    cartStore.allCart(shopId)
    return {allCart}
  }
  return { cartList, changeItemToCart ,changeChecked,clearCart,allCart};
};
